package com.decheng.mq.receiver;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;

/**
 * @author 孔德成
 * @slogan 致敬大师，致敬未来的你
 * @date 2021/9/16 2:29 下午
 * @desc 简单模式消费者
 */
@Slf4j
// 监听的队列
@RabbitListener(queues = "simple.hello")
public class SimpleReceiver {

    /**
     * 消费者从队列 simple.hello 中获取消息
     *
     * @param in 生产者发送的消息
     */
    @RabbitHandler
    public void receive(String in) {
        log.info(" [x] Received '{}'", in);

    }
}
